﻿@inherits CmsWebViewPage

<div id="contactForm">
	@{
		var cap = new Captcha();
		cap.AltValidationFailText = null; // trigger default text

		using (var cmtFrm = CarrotCakeHtml.BeginContactForm(new AjaxOptions { UpdateTargetId = "contactForm" })) {
			var cmt = cmtFrm.GetModelHelper("_contactform", cap);
			if (!cmt.ViewData.Model.IsSaved) {
				@cmt.ValidationSummary(true, "", new { @class = "text-danger" })

				<div>
					@cmt.LabelFor(m => m.CommenterEmail)
					@cmt.ValidationMessageFor(m => m.CommenterEmail, "", new { @class = "text-danger" })
					<br />
					@cmt.TextBoxFor(m => m.CommenterEmail)
				</div>

				<div>
					@cmt.LabelFor(m => m.CommenterEmail)
					@cmt.ValidationMessageFor(m => m.CommenterEmail, "", new { @class = "text-danger" })
					<br />
					@cmt.TextBoxFor(m => m.CommenterEmail)
				</div>

				<div>
					@cmt.LabelFor(m => m.PostCommentText, "Your Comments")
					@cmt.ValidationMessageFor(m => m.PostCommentText, "", new { @class = "text-danger" })
					<br />
					@cmt.TextAreaFor(m => m.PostCommentText, new { rows = "5", cols = "50" })
				</div>

				<div>
					@cap<br />
					@cap.Instructions <br />
					@cmt.TextBoxFor(m => m.ValidationValue)
					@cmt.ValidationMessageFor(m => m.ValidationValue, "", new { @class = "text-danger" })
				</div>

				<br />
				<input class="button" type="submit" value="Submit" />
				<input class="button" type="reset" value="Clear form" />
			} else {
				<p>Thank you for your comment.</p>
			}
		}
	}
</div>